﻿using Extreme.SPFramework.DependencyInjection;
using Extreme.SPFramework.Test.Interfaces;
using NUnit.Framework;

namespace Extreme.SPFramework.Test.DependencyInjection
{
    /// <summary>
    /// IOC lifestyle test fixture
    /// </summary>
    [TestFixture]
    public class LifestyleTestFixture
    {
        /// <summary>
        /// Tests singleton with IOC
        /// </summary>
        [Test]
        public void TestSingleton()
        {
            var service = ServiceProvider.GetInstance<ISingletonInterface>();
            var firstId = service.UniqueId;

            service = ServiceProvider.GetInstance<ISingletonInterface>();
            Assert.AreEqual(firstId, service.UniqueId);
        }
    }
}
